class_name PopupTip
extends Control

#region 属性
@export var rich_text:RichTextLabel
@export var animation_player:AnimationPlayer
var connect_obj:ConnectObj
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
#endregion
#region 公共方法
func init_text(text:String):
	self.rich_text.text = text
	_popup()
#endregion
#region 私有方法
func _popup():
	animation_player.play("popup")
	connect_obj = ConnectObj.new(animation_player.animation_finished,[_on_animation_finished])
func _on_animation_finished(anim_name:StringName):
	if anim_name == "popup":
		if connect_obj:
			connect_obj.disconnect_all()
			connect_obj = null
		queue_free()
#endregion
#region 生命周期函数
#endregion
